﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Oxite.Infrastructure;
using Oxite.Validation;
using ECube.Org.Repositories;
using ECube.Org.Models;
namespace ECube.Org.Services
{
    public class OrganizationService : IOrganizationService
    {
        private readonly IOrganizationRepository repository;
        private readonly IValidationService validator;
        private readonly IPluginEngine pluginEngine;
        private readonly IOxiteCacheModule cache;
        private readonly OxiteContext context;

        public OrganizationService(IOrganizationRepository repository, IValidationService validator, IPluginEngine pluginEngine, IModulesLoaded modules, OxiteContext context)
        {
            this.repository = repository;
            this.validator = validator;
            this.pluginEngine = pluginEngine;
            this.cache = modules.GetModules<IOxiteCacheModule>().Reverse().First();
            this.context = context;
        }

        #region IOrganizationService 成员

        public IEnumerable<Organization> GetOrganizations()
        {
            return repository.GetOrganizations();
        }
        public Organization GetOrganization(int id)
        {
            return repository.GetOrganization(id);
        }

        #endregion
    }
}
